//
//  LinkList.h
//  Learn_C_Cpp
//
//  Created by jinbang.li on 2023/6/12.
//

#ifndef LinkList_h
#define LinkList_h

#include <stdio.h>
typedef int ElementType;
//单链表
typedef struct SingleListNode{
    ElementType data;
    struct SingleListNode *next;
}SingleListNode;

void SingleListPrint(SingleListNode *phead);

void SingleListPushBack(SingleListNode **phead,ElementType x);
void SingleListPushFront(SingleListNode **phead,ElementType x);
void SingleListNodeInsert(SingleListNode **phead,size_t pos,ElementType x);

void SingleListPopBack(SingleListNode **phead);
void SingleListPopFront(SingleListNode **phead);
void SingleListEraseAfter(SingleListNode **phead,size_t pos);

void SingleListUpdate(SingleListNode **phead,size_t pos,ElementType x);

SingleListNode* SLFind(SingleListNode *phead,ElementType x);

void SListDestory(SingleListNode *phead);


#endif /* LinkList_h */
